﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace emlak
{
    public partial class frmTalepArama : Form
    {
        public frmTalepArama()
        {
            InitializeComponent();
        }

        private void btnArama_Click(object sender, EventArgs e)
        {
            if (txtIlanId.Text != "")
            {
                dgTalepArama.DataSource = Sorgu.EvTalepGetir_ID( Convert.ToInt32( txtIlanId.Text ) );
            }
        }

        private void btnArama_Click_1(object sender, EventArgs e)
        {
            if (rdbilanID.Checked == true)
            {

                if (rdbArsaArazi.Checked == true)
                    dgTalepArama.DataSource = Sorgu.ArsaTalepGetir_ID(Convert.ToInt32(txtIlanId.Text));
                else if (rdbEvKooperatif.Checked == true)
                    dgTalepArama.DataSource = Sorgu.EvTalepGetir_ID(Convert.ToInt32(txtIlanId.Text));
                else if (rdbIsYeriBuro.Checked == true)
                    dgTalepArama.DataSource = Sorgu.IsyeriTalepGetir_ID(Convert.ToInt32(txtIlanId.Text));
                else MessageBox.Show("Hatalı seçim");
            }
        }



        
    }
}
